<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditLinkType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'href';
   $map[] = $this->name.'description';
   $this->map = &$map;
 }

 function render_html () {
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '  <table border="0">'."\n";
  $html .= '     <tr>'."\n";
  $html .= '      <td width="100">HREF:</td>'."\n";
  $html .= '      <td>'."\n";
//  $html .= '        <input tabindex="'.$this->sender->getNextTabindex($this->name.'href').'" name="'.$this->name.'href" value="'.htmlspecialchars($this->getValue($this->name.'href')).'" size="50" maxlength="255"> <a href="javascript:;" onClick="fenster=window.open(\'cmsEditlink/OpenDialogFrame.php?caller='.$this->name.'href&mode=href\',\'LinkOpenDialog\',\'width=300,height=300,resizable\');"><img src="open_but.gif" border="0" align="middle"></a>';
  $html .= '        <input tabindex="'.$this->sender->getNextTabindex($this->name.'href').'" name="'.$this->name.'href" value="'.htmlspecialchars($this->getValue($this->name.'href')).'" size="50" maxlength="255"> <a href="javascript:;" onClick="top.showModal(\'Link ausw&auml;hlen\', \'cms/cmsEditlink/OpenDialogFrame.php?caller='.$this->name.'href&mode=href\', window, 300, 300, true);"><img src="open_but.gif" border="0" align="middle"></a>';
  if (preg_match('/^pageid:(.*)$/',$this->getValue($this->name.'href'),$matches))
  {
        $html .= '<br/><b>Dokument:</b> '.$GLOBALS['docs']->extractPathStr($matches[1],'name',' / ');
  }
  $html .= '<td>'."\n";
  $html .= '     </tr>'."\n";
  $html .= '     <tr>'."\n";
  $html .= '      <td>Text:</td>'."\n";
  $html .= '      <td>'."\n";
  $html .= '        <input tabindex="'.$this->sender->getNextTabindex($this->name.'description').'" name="'.$this->name.'description" value="'.htmlspecialchars($this->getValue($this->name.'description')).'" size="50" maxlength="255"></td>'."\n";
  $html .= '     </tr>'."\n";
  $html .= '  </table>'."\n";
  $html .= '</div><!-- / type link -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>
